<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>1.v-for指令</title>
    <!-- 引入Vue -->
    <script type="text/javascript" src="../../js/vue.js"></script>
  </head>
  <body>
    <!-- 准备好一个容器-->
    <div id="demo">
      <h2>人员列表</h2>
      <ul>
        <li v-for="(person,index) in personList" :key="person.id">
          姓名：{{person.name}}，年龄：{{person.age}}，索引值：{{index}}
        </li>
      </ul>
    </div>

    <script type="text/javascript">
      new Vue({
        el:'#demo',
        data:{
          personList:[
            {id:'asdgtasfd01',name:'张三',age:34},
            {id:'asdgtasfd02',name:'李四',age:19},
            {id:'asdgtasfd03',name:'王五',age:20}
          ]
        }
      })
    </script>
  </body>
</html>